/* eslint-disable */
// 邮箱校验
export function email (value) {
  const reg = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i
  return reg.test(value)
}
// 手机校验
export function mobile (value) {
  value = value.replace(/[^-|\d]/g, '')
  return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9\-]{10,13}$/.test(value)
}
// 金钱的校验
export function money (value) {
  return /^(([0-9]+)|([0-9]+\.[0-9]{1,2}))$/.test(value)
}
// 银行卡号
export function bankCardNumber (v) {
  return /^([0-9]{10,28})$/.test(v)
}
// 用户名
export function accountName (v) {
  let val = v.replace(/\./g, '').replace(/\·/g, '')
  return /^[\u4e00-\u9fa5]{2,16}|[a-zA-Z0-9_-]{2,16}$/.test(val)
}
export function username (value) {
  return /^[\w+]{6,16}$/.test(value)
}
// 密码
export function password (value) {
  return /^[\w!@#$%^&*.]{8,16}$/.test(value)
}
// 不包含特殊字符的密码 仅限字母和数字
export function password2 (value) {
  return /^[A-Za-z0-9]{8,16}$/.test(value)
}
// 安全密码
export function safetyPassword (value) {
  return /^[\w!@#$%^&*.]{6}$/.test(value)
}
// 安全密码6位纯数字
export function safetyPassword6Num (value) {
  return /^\d{6}$/g.test(value)
}
// 中文字符
export function chineseText (v) {
  return /^[\u4e00-\u9fa5|\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5|.|,!\[\]]{0,999}$/.test(v)
}
// http: 校验
export function checkHttp (v) {
  return /^(?=^.{3,255}$)(http(s)?:\/\/)+(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([?&]\w+=\w*)*$/.test(v)
}
// url: 非http校验
export function checkNotHttp (v) {
  return /^(?=^.{3,255}$)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/.test(v)
}
// 数字校验
export function isNumber (v) {
  return /^[0-9]*$/.test(v)
}
// 正整数校验
export function integerNumber (v) {
  return /^\d+$/.test(v)
}
// IP校验
export function checkIP (v) {
  return /^((25[0-5]|2[0-4]\d|[01]?\d\d?)($|(?!\.$)\.)){4}$/.test(v)
}
